function getCookie(key) {
	let strCookie = document.cookie;
	let arrCookie = strCookie.split("; ");

	for (let i = 0; i < arrCookie.length; i++) {
		let item = arrCookie[i].split("=");

		if (key == item[0]) {
			return item[1];
		}
	}

	return "";
}


function setCookie(key, value, day) {
	if (day != undefined) {
		let date = new Date();
		date.setDate(date.getDate() + day);
		document.cookie = `${key}=${value};expires=` + date;
	} else {
		document.cookie = `${key}=${value}`;
	}
}


function deleteCookie(key) {
	setCookie(key, '', -1);
}
